In recent years, computer networks have been popularized and large capacity recording and reproducing mediums come out. As a result, music data has been quite often dealt on computers. When music data is handled on computers, irreversible codes such as MP3 (MPEG1 Audio Layer-3), AAC (MPEG2 Advanced Audio Coding), ATRAC (Adaptive TRansform Acoustic Coding: trademark) 3, and so forth have been often used. This is because irreversible codes can attain an highly efficient compression.
In other words, compression encodes are categorized as irreversible codes and reversible codes. The irreversible codes are effective when data is highly efficiently compressed. However, the irreversible codes result in a data loss. Thus, when for example music data is compressed with an irreversible code, since a data loss takes place, the audio quality deteriorates.
In contrast, reversible codes allow data which has been compressed to be completely restored without a data loss. Thus, when for example music data is compressed with a reversible code, the audio quality does not deteriorate. However, it is difficult to attain a higher compression rate with a reversible code than with an irreversible code.
Conventionally, to efficiently transfer music data at a limited transmission rate and efficiently record the music data on a recording and reproducing medium having a limited capacity, an irreversible code has been mainly used.
However, nowadays broadband lines have been used and large quantity data transferred therethrough. In addition, large capacity and inexpensive recording and reproducing mediums have come out. Thus, it is thought that audio quality will be valued above the compression rate. In other words, it is thought that a reversible code, which is free of deterioration of audio quality, will become more important than an irreversible code, which involves deterioration of audio quality.
Conventionally, to maintain affinity of music data recorded on a CD-DA (Compact Disc Digital Audio) disc with a computer, it is thought that music data is recorded in CD-ROM (Compact Disc Read Only Memory) format. At that point, it is thought that music data is encoded so as to protect copyright thereof.
However, since the record capacity of user data for one frame in the CD-ROM format is smaller than the record capacity of music data for one frame of a CD-DA disc, if music data of the CD-DA disc is recorded in the CD-ROM format, it will become difficult to attain the same reproduction duration as the CD-DA disc.
In other words, in the CD, data is managed in the unit of a block composed of 98 frames. In the CD-DA disc, data of 24 bytes is allocated to each frame. The data capacity of one block composed of 98 frames amounts to (98×24=2352 bytes).
In contrast, in the CD-ROM format, a sync, a header, and an error correction code are added to data of each block. In other words, when an error occurs in data on the CD-ROM, since the error cannot be dealt with an interpolating process or the like, a stronger error correcting process is required. To do that, error correction auxiliary data is added. Thus, the capacity of user data for one block becomes 2048 bytes.
In the CD-DA disc, music data of 2352 bytes is recorded per block. In contrast, in the CD-ROM, the capacity of user data of one block is 2048 bytes. When music data recorded on one DC-DA disc is recorded in the CD-ROM format, the data amount becomes insufficient. Thus, music data recorded on one CD-DA disc cannot be fully recorded on one disc in the CD-ROM format.
Thus, it is thought that music data of 2352 bytes as one block is compressed to around 2048 bytes and recorded in the CD-ROM format. Since music data is compressed from 2352 bytes to 2048 bytes, it can be sufficiently compressed with a reversible code. At that point, when music data is compressed with a reversible code, the audio quality of music data hardly deteriorates.
From the forgoing point of view, it is desired that a PCM audio signal such as music data should be effectively compressed with a reversible code. As reversible codes, Huffman code, arithmetic code, moving Huffman code, universal codes (LZ Lempel Ziv) 77, LZ SS, LZ 78, and LZ W), and so forth are known. The reversible code encoding basically uses the biasing of data, removes a meaningless code, and compresses a meaningful code. In contrast, since a music PCM signal is composed of random numbers, it cannot be properly compressed with a reversible code. When the signal is encoded with a reversible code, the data amount of the resultant data may become larger than that of the original data.
When a PCM audio signal is encoded on real time basis and recorded and reproduced to and from the medium, it is desired that both an encoding process and a decoding process should be performed at high speed. However, in the conventional reversibly compressing system, in particular, the encoding process takes a long time.
Therefore, an object of the present invention is to provide an encoding apparatus and method, a decoding apparatus and method, and a recording medium recording apparatus and method which allow a PCM audio signal to be effectively reversibly encoded and both an encoding process and a decoding process to be performed at high speed.